/**
 * Created by hanfei on 17/4/25.
 */
jQuery(function ($) {

});

MemberService = {
    view: function (id) {
        window.location.href = HuiqianUtil.getWebRootPath() + "/member/view/" + id + ".htmls";
    },
    showDelete: function (id) {
        $("#currentId").html(id);
        $('#deleteModal').modal();
    },
    delete: function () {
        var that = this;
        var id = $.trim($("#currentId").html());
        $.ajax({
            cache: true,
            type: "GET",
            url: HuiqianUtil.getWebRootPath() + "/member/delete/" + id + ".htmls",
            async: false,
            error: function (request) {
                alert("Connection error");
            },
            success: function (data) {
                $('#deleteModal').modal('hide');
                window.location.href = HuiqianUtil.getWebRootPath() + "/member/findMember.htmls";
            }
        });
    },
    verify: function (id) {
        $.ajax({
            cache: true,
            type: "GET",
            url: HuiqianUtil.getWebRootPath() + "/member/verify/" + id + ".htmls",
            async: false,
            error: function (request) {
                alert("Connection error");
            },
            success: function (data) {
                alert("success");
                window.location.href = HuiqianUtil.getWebRootPath() + "/member/findMember.htmls";
            }
        });
    },
    modify: function () {
        $.ajax({
            cache: true,
            type: "POST",
            url: HuiqianUtil.getWebRootPath() + "/member/modify.htmls",
            data: $('#memberForm').serialize(),// 你的formid
            async: false,
            error: function (request) {
                alert("Connection error");
            },
            success: function (data) {
                alert("success.");
            }
        });
    }
}